Redim Method
Resizes the passed array.
Syntax
Redim newSize1, [newSizeN]
Parameters | ||
newSize1 |
The new size for the array. In the case of multi-dimensional arrays, the new size for the first dimension of the array. |
|
newSizeN (Optional) |
The new size for the Nth dimension of the array. |
Notes
The Redim method is used to increase or reduce the number of elements in the array specified. Arrays are zero-based (the first element is zero) so you resize the array using a number that is one less than the number of elements you actually want.
Examples
This example reduces the aNames array to 11 elements.
This example adds 10 elements to the aNames array
.
This example reduces the aPeople array to 11 elements for the first dimension and 6 elements for the second dimension
.
See Also
Dim statement; Array, Join, Split, Ubound functions; Append, IndexOf, Insert, Pop, Remove, Shuffle, Sort, Sortwith methods; ParamArray keyword.